﻿using WMS.FC.Domain.DomainObject.System;

namespace WMS.FC.Domain.PersistenceObject.History
{
    /// <summary>
    /// 电池运行履历
    /// </summary>
    [SplitTable(TableName = "HIS_CELL_PROCESS", TableDescription = "电池运行履历")]
    [SplitTableIndex("1", nameof(CreateDate), nameof(CellBarcode), false)]
    [SplitTableIndex("2", nameof(CreateDate), nameof(TypeCode), false)]
    [SplitTableIndex("3", nameof(CreateDate), nameof(TrayBarcode), false)]
    [SplitTableIndex("4", nameof(CreateDate), nameof(TechnologyRouteCode), false)]
    [SplitTableIndex("5", nameof(CreateDate), nameof(TechnologyProcessCode), false)]
    [SplitTableIndex("6", nameof(CreateDate), nameof(NgCode), false)]
    [SplitTableIndex("7", nameof(CreateDate), nameof(IsRework), false)]
    [SplitTableIndex("SEARCH", nameof(CreateDate), nameof(CellBarcode), nameof(TypeCode), nameof(TrayBarcode), nameof(TechnologyRouteCode), nameof(TechnologyProcessCode), nameof(NgCode), nameof(IsRework), false)]
    public class HisCellProcessPO : HistoryPOBase
    {
        /// <summary>
        /// 电池条码
        /// </summary>
        [SplitTableColumn(ColumnName = "CELL_BARCODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "电池条码")]
        public string CellBarcode { get; set; } = string.Empty;

        /// <summary>
        /// 类型编码
        /// </summary>
        [SplitTableColumn(ColumnName = "TYPE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "类型编码")]
        public string TypeCode { get; set; } = string.Empty;

        /// <summary>
        /// 托盘条码
        /// </summary>
        [SplitTableColumn(ColumnName = "TRAY_BARCODE", ColumnDataType = "VARCHAR2(50)", IsNullable = true, ColumnDescription = "托盘条码")]
        public string? TrayBarcode { get; set; }

        /// <summary>
        /// 电池位置
        /// </summary>
        [SplitTableColumn(ColumnName = "CELL_POSITION", ColumnDataType = "NUMBER(10)", IsNullable = true, ColumnDescription = "电池位置")]
        public int? CellPosition { get; set; }

        /// <summary>
        /// 工艺路径编码
        /// </summary>
        [SplitTableColumn(ColumnName = "TECHNOLOGY_ROUTE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "工艺路径编码")]
        public string TechnologyRouteCode { get; set; } = string.Empty;

        /// <summary>
        /// 工艺工序编码
        /// </summary>
        [SplitTableColumn(ColumnName = "TECHNOLOGY_PROCESS_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "工艺工序编码")]
        public string TechnologyProcessCode { get; set; } = string.Empty;

        /// <summary>
        /// NG编码
        /// </summary>
        [SplitTableColumn(ColumnName = "NG_CODE", ColumnDataType = "VARCHAR2(50)", IsNullable = true, ColumnDescription = "NG编码")]
        public string? NgCode { get; set; }

        /// <summary>
        /// 是否返修
        /// </summary>
        [SplitTableColumn(ColumnName = "IS_REWORK", ColumnDataType = "NUMBER(1)", ColumnDescription = "是否返修")]
        public bool IsRework { get; set; }

        /// <summary>
        /// 分选等级
        /// </summary>
        [SplitTableColumn(ColumnName = "RANK_VALUE", ColumnDataType = "VARCHAR2(50)", IsNullable = true, ColumnDescription = "分选等级")]
        public string? RankValue { get; set; }
    }
}
